package com.useeinfo.oa.modules.wuHanCommon.base.enums;

import com.useeinfo.framework.sugar.func.lang.StringUtils;

/**
 * 点位所属系统
 */
public enum PointSystem {

    BODY_CIRCULATION_WATER("BODY_CIRCULATION_WATER", "车身循环水系统"),
    PROCESS_CHILLED_WATER("PROCESS_CHILLED_WATER", "工艺冷冻水系统"),
    AIR_CONDITIONING_CHILLED_WATER("AIR_CONDITIONING_CHILLED_WATER", "空调冷冻水系统"),
    HOT_WATER("HOT_WATER", "空调热水系统"),
    COMPRESSED_AIR("COMPRESSED_AIR", "压缩空气系统");


    private String code;

    private String name;

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }


    PointSystem(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static PointSystem covert(String name) {
        if (StringUtils.isBlank(name)) {
            return null;
        }
        switch (name) {
            case "车身循环水系统":
                return PointSystem.BODY_CIRCULATION_WATER;
            case "工艺冷冻水系统":
                return PointSystem.PROCESS_CHILLED_WATER;
            case "空调冷冻水系统":
                return PointSystem.AIR_CONDITIONING_CHILLED_WATER;
            case "空调热水系统":
                return PointSystem.HOT_WATER;
            case "压缩空气系统":
                return PointSystem.COMPRESSED_AIR;
        }
        return null;
    }
}
